import request from './request'

export function query ({currentPage = 1, perPage = 10, batchId, likeCreateTime} = {}) {
  return request({
    url: '/white/findGroupList.do',
    method: 'GET',
    params: {currentPage, perPage, batchId, likeCreateTime}
  })
}

export function create ({butchId, butchName, createOper, custId, recordStat}) {
  return request({
    url: '/white/ addWhite.do',
    method: 'POST',
    body: {butchId, butchName, createOper, custId, recordStat}
  })
}

export function upLoad ({files, butchId, butchName, createOper}) {
  return request({
    url: '/white/upLoad.do',
    method: 'POST',
    body: {files, butchId, butchName, createOper}
  })
}

export function downLoad ({name} = {}) {
  return request({
    url: '/white/download.do',
    method: 'GET',
    params: {name}
  })
}

export function del ({batchId}) {
  return request({
    url: '/white/delete.do',
    method: 'POST',
    body: {batchId}
  })
}

export function queryChild ({currentPage = 1, perPage = 10, butchId, custId, recordStat} = {}) {
  return request({
    url: '/white/findBatchIdList.do',
    method: 'GET',
    params: {currentPage, perPage, butchId, custId, recordStat}
  })
}

export function delChild ({id}) {
  return request({
    url: '/white/deleteWhite.do',
    method: 'POST',
    body: {id}
  })
}
